<template>
<el-row>
    <el-col :span="14"><div class="grid-content bg-purple">
       <LoginData></LoginData>
       <BookData></BookData>
       
    </div></el-col>
    <el-col :span="10"><div class="grid-content bg-purple-light">
        <div class="card" v-if="sdata"> 
            <div >
                <i class="el-icon-user" size="100%"></i>
                <p>用户人数:{{sdata.user}}</p>
            </div>
            <div >
                <i class="el-icon-more"></i>
                <p>评论数:{{sdata.user}}</p>
            </div>
            <div >
                <i class="el-icon-tickets"></i>
                <p>账号库存:{{sdata.book}}</p>
            </div>
            <div >
                <i class="el-icon-view"></i>
                <p>app周活跃数:{{sdata.active}}</p>
            </div>
        </div>
        <SexData></SexData>
       <MyComment></MyComment>

    </div></el-col>
</el-row>
</template>

<script>
import LoginData from './LoginData.vue'
import BookData from './BookData.vue'
import SexData from './SexData.vue'
import  MyComment from './MyComment.vue'

export default {
    name:'HomeData',
    components:{LoginData,BookData,SexData,MyComment},
    data(){
        return{
            sdata:null,
            url:'http://192.168.35.36:3005',
        }
    },
    created(){
        this.$axios.get(`${this.url}/totaldata/data`).then(content=>{
          console.log(content);
            this.sdata=content.data
        })
    }
}
</script>

<style lang="less" scoped>
  .el-row {
    margin-bottom: 20px;
    &:last-child {
      margin-bottom: 0;
    }
  }
  .el-col {
    border-radius: 4px;
  }
  .bg-purple-dark {
    background: #99a9bf;
  }
  .bg-purple {
    background: #d3dce6;
  }
  .bg-purple-light {
    background: #e5e9f2;
  }
  .grid-content {
    border-radius: 4px;
    min-height: 36px;
  }
  .row-bg {
    padding: 10px 0;
    background-color: #f9fafc;
  }
  .box-card{
    .el-avatar{
        width: 70px;
        height: 70px;
        float: left;
    }
  }
  .card{
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    padding-top: 30px;
    margin-bottom: 20px;
    div{
        display: flex;
        flex-wrap: wrap;
        width: 40%;
        border-radius: 10px;
        background-color: #DCE2F1 ;
        border: 1px solid #ccc;
        height: 50px;
        align-items: center;
        overflow: hidden;
        margin-bottom: 20px;
        i{
            background-color: skyblue;
            width: 20%;
            line-height: 50px;
        }
        p{
            margin-left: 10px;

        }
    }
  }
  .el-carousel__item h3 {
    color: #475669;
    font-size: 14px;
    opacity: 0.75;
    line-height: 50px;
    margin: 0;
  }
  
  .el-carousel__item:nth-child(2n) {
    background-color: #99a9bf;
  }
  
  .el-carousel__item:nth-child(2n+1) {
    background-color: #d3dce6;
  }

</style>